package springProvider.health;

import javax.inject.Inject;
import org.springframework.boot.actuate.health.Status;
import org.springframework.stereotype.Component;
import com.netflix.appinfo.HealthCheckHandler;
import com.netflix.appinfo.InstanceInfo.InstanceStatus;
@Component
public class MyHealthCheckHandler implements HealthCheckHandler{
	@Inject
	private MyHealthindicator indicator;
	@Override
	public InstanceStatus getStatus(InstanceStatus currentStatus) {
		Status status = indicator.health().getStatus();
		if(status.equals(Status.UP)) {
			return InstanceStatus.UP;
		}else {
			return InstanceStatus.DOWN;
		}
	}

}
